<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<jsp:useBean id="othhome_friend1" scope="session" class="software.Use_user"/>
<jsp:useBean id="othhome_friend2" scope="session" class="software.Fri_done"/>
<%@ page import="software.Paination" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
 <html>
 <head>
 <base href="<%=basePath%>">
 <title>My JSP 'othhome_friend.jsp' starting page</title>
 </head>
  <body>
  <% 
  String IDseloth1=session.getAttribute("IDoth").toString();
    int  IDseloth=Integer.parseInt(IDseloth1); 
  Paination pa=(Paination)session.getAttribute("othhome_friend3"); 
  %>
 <a href="othhome_main.jsp?IDseloth=<%=IDseloth%>&mk=1">返回他的主页</a>
    <p>
         共有<font color="red" size="1"><%=pa.getTotalRows() %></font>个好友
         <br/>
         	<%if(pa.isHasPreviousPage())
       		out.print("<a href='othhome_friend2.jsp?requestPage=previousPage'>上一页</a>");%>
       		<%if(pa.isHasNextPage())
       		out.print("<a href='othhome_friend2.jsp?requestPage=nextPage'>下一页</a>");%>
    </p>

  <form action="othhome_friend2.jsp?IDseloth=<%=IDseloth%> method="post" name="page" onsubmit="return checkPage(page)">  
     	第<input type="text" name="jump" size="3" maxlength="2">页
       	<input type="submit" value="转到>>">
 </form>
 <!--  页面刷新-->
  <br>
  <table align="left" border="1" width="60" height="70">  
   <%     
        List notes=new ArrayList();
         String requestPage=request.getParameter("requestPage");
     	 if(request.getParameter("jump")!=null){
            String jumpPage1 =request.getParameter("jump");
            int jumpPage = Integer.parseInt(jumpPage1);
            notes=pa.AppointPageList(jumpPage);
            //window.onload = reurl (){ setTimeout("reurl();",500); }         
      	 }  
         else{
          if(requestPage.equals("previousPage")){
           notes =pa.getPreviousPageList();
        	}else if(requestPage.equals("nextPage")){
            notes=pa.getNextPageList();
            }  
            }
           for(int m=0;m<notes.size();m++){   
           %>
          <tr bgcolor='#FFCC99' align="center">
          <td height="50%" width="70%">
          <% othhome_friend1.setUsername((String)notes.get(m));
    	  int Id3=othhome_friend1.getId(); %>
     	 <%=(String)notes.get(m)%>
     	 </td>
             </tr>
             <%
          }  
   %>
   </table>
   <br/>
      当前是第<font color="red" size="1"><%=pa.getCurrentPage()+"/"+pa.getTotalPages() %></font>页
     <a href="javascript:location.reload()">刷新</a>
  </body>
</html>
